<template>
	<view class="buys_news">
		
		
		<view class="buys_item" v-for="value in videolist" @click="tabs('/pages/shangxueyuan/detail?id='+value.id)">
			<view class="buys_centers">
			<view class="title-bar">
				<image :src="value.image"></image>
			</view>
			<view class="buy-right">
				<view class="title">{{value.title}}</view>
				<view class="btn-wrappers">
					<view class="bom-btn">播放</view>
				</view>
			 </view>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	import { goPage } from '@/libs/order.js'
	import {
		getindex_list,getcollectList
	} from '@/api/api.js';
	export default {
			data() {
				return {
					content:'',
					name:'',
					phone:'',
					videolist:[]
				}	
			},
			onLoad() {
				getcollectList(1,20).then(res => {
					console.log(res.data.data.data)
					this.videolist=res.data.data.data
				});
			},
			created() {},
			mounted() {
				
			},
			methods: {
				tabs(url){
					//url='/pages/goods_details/index?id=62'
					goPage().then(res=>{
						uni.navigateTo({
							url:url
						})
					})
				},
				btn:function(){
					let that=this
					if (!that.content) return that.$util.Tips({
						title: '请填写建议内容'
					});
					if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone)) return that.$util.Tips({
						title: '请输入正确的手机号码'
					});
					if (!that.name) return that.$util.Tips({
						title: '请填写姓名'
					});
					
					addsuggest(that.content,that.phone,that.name).then(res => {
						that.content=''
						that.phone=''
						that.name=''
						if (res.status==200)
							that.$util.Tips({
								title: '成功',
								icon: 'success'
							});
						else
							that.$util.Tips({
								title: '失败',
								icon: 'error'
							});
					}).catch(err => {
						return that.$util.Tips({
							title: err
						});
					})
				}
			},
	}
	
	
</script>

<style lang="scss">
	.buys_news{
		width: 100%;
		margin: 0rpx auto;
		background: #FFFFFF;
		.buys_item{
			width: 95%;
			padding: 3%;
			margin: 0rpx auto;
			overflow: hidden;
			.buys_centers{
				width: 100%;
				padding:0rpx 0rpx 15px 0rpx;
				overflow: hidden;
				margin: 0rpx auto;
				border-bottom: 2rpx solid #EEEEEE;
			}
			
			.title-bar{
				float: left;
				width: 40%;
				overflow: hidden;
				image{
					width: 288rpx;
					height: 148rpx;
				}
			}
		}
		.buy-right{
		   float: right;
		   width: 58%;
		   margin-left: 2%;
		   overflow: hidden;
		   .title{
			   width: 100%;
			   overflow: hidden;
			   line-height: 32rpx;
			   font-size: 28rpx;
			   text-overflow: ellipsis;
			   display: -webkit-box;
			   -webkit-line-clamp:2;
			   -webkit-box-orient: vertical;
		   }
		   .btn-wrappers{
			   width: 100%;
			   overflow: hidden;
			   margin: 10rpx auto auto auto;
			   .bom-btn{
				   float: right;
				   width: 128rpx;
				   line-height: 48rpx;
				   text-align: center;
				   color: #FFFFFF;
				   background: #E8C787;
				   border-radius: 6rpx;
			   }
		   }
		}
	}
	
</style>
